//+------------------------------------------------------------------+
//|                                               FollowOrderDll.mqh |
//|                                     Copyright 2014, yellowmouse. |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, yellowmouse."
#property link      ""
//+------------------------------------------------------------------+
//| defines                                                          |
//+------------------------------------------------------------------+
// #define MacrosHello   "Hello, world!"
// #define MacrosYear    2010
//+------------------------------------------------------------------+
//| DLL imports                                                      |
//+------------------------------------------------------------------+
// #import "user32.dll"
//   int      SendMessageA(int hWnd,int Msg,int wParam,int lParam);
// #import "my_expert.dll"
//   int      ExpertRecalculate(int wParam,int lParam);
// #import
//+------------------------------------------------------------------+
//| EX5 imports                                                      |
//+------------------------------------------------------------------+
// #import "stdlib.ex5"
//   string ErrorDescription(int error_code);
// #import
//+------------------------------------------------------------------+

#import "MT5FollowOrder.dll"
void UdpInit(void);
void UdpDeinit(void);
int UdpSocket(bool broadcast=false);
int UdpBind(int sock,ushort port);
int UdpSendTo(int sock,const char& remoteIp[],ushort remotePort,const char &mesg[],int len);
int UdpRecv(int sock,char& buf[],int bufLen,char& remoteIp[],int& remotePort,int timeout=0);
int UdpBroadcast(int sock,ushort remotePort,const char &mesg[],int len);
void UdpClose(int sock);
int UdpError(void);



int	z_ctx_new (void);
int	z_ctx_destroy (int context);
int	z_socket (int ctx, int type);

int   z_close (int s);

int	 z_setsockopt (int s, int option, const char &optval[],
int optvallen);

int   z_getsockopt (int s, int option, char &optval[],
int &optvallen);

int	 z_bind (int s, const char &addr[]);

int	 z_connect (int s, const char &addr[]);

int	 z_unbind (int s, const char &addr[]);

int	 z_disconnect (int s, const char &addr[]);

int	 z_send (int s, const char &buf[], int len, int flags);

int	 z_recv (int s, char &buf[], int len, int flags);

int	 z_errno (void);

void	z_strerror (int errnum,char &strerror[],int len);

int	 z_pollin(int s,int timeout);

int	 z_pollout(int s,int timeout);

#import

/*  Socket types.                                                             */ 

#define ZMQ_PAIR 0

#define ZMQ_PUB 1

#define ZMQ_SUB 2

#define ZMQ_REQ 3

#define ZMQ_REP 4

#define ZMQ_DEALER 5

#define ZMQ_ROUTER 6

#define ZMQ_PULL 7

#define ZMQ_PUSH 8

#define ZMQ_XPUB 9

#define ZMQ_XSUB 10

/*  Socket options.                                                           */

#define ZMQ_AFFINITY 4

#define ZMQ_IDENTITY 5

#define ZMQ_SUBSCRIBE 6

#define ZMQ_UNSUBSCRIBE 7

#define ZMQ_RATE 8

#define ZMQ_RECOVERY_IVL 9

#define ZMQ_SNDBUF 11

#define ZMQ_RCVBUF 12

#define ZMQ_RCVMORE 13

#define ZMQ_FD 14

#define ZMQ_EVENTS 15

#define ZMQ_TYPE 16

#define ZMQ_LINGER 17

#define ZMQ_RECONNECT_IVL 18

#define ZMQ_BACKLOG 19

#define ZMQ_RECONNECT_IVL_MAX 21

#define ZMQ_MAXMSGSIZE 22

#define ZMQ_SNDHWM 23

#define ZMQ_RCVHWM 24

#define ZMQ_MULTICAST_HOPS 25

#define ZMQ_RCVTIMEO 27

#define ZMQ_SNDTIMEO 28

#define ZMQ_IPV4ONLY 31

#define ZMQ_LAST_ENDPOINT 32

#define ZMQ_FAIL_UNROUTABLE 33

#define ZMQ_TCP_KEEPALIVE 34

#define ZMQ_TCP_KEEPALIVE_CNT 35

#define ZMQ_TCP_KEEPALIVE_IDLE 36

#define ZMQ_TCP_KEEPALIVE_INTVL 37

#define ZMQ_TCP_ACCEPT_FILTER 38
